package com.freda.oa.flow.utl;

import org.eredlab.g4.arm.util.idgenerator.IDHelper;
import org.eredlab.g4.arm.util.idgenerator.IdGenerator;
import org.eredlab.g4.ccl.id.generator.DefaultIDGenerator;

public class FlowIdHelper extends IDHelper {
	/**
	 * instance ID
	 */
	private static DefaultIDGenerator defaultIDGenerator_instanceId = null;
	/**
	 * task ID
	 */
	private static DefaultIDGenerator defaultIDGenerator_taskId = null;
	/**
	 * hisTask ID
	 */
	private static DefaultIDGenerator defaultIDGenerator_hisTaskId = null;
	/**
	 * part ID
	 */
	private static DefaultIDGenerator defaultIDGenerator_partId = null;
	
	//private static DefaultIDGenerator defaultIDGenerator_myAppId = null;

	static {
		IdGenerator idGenerator_instance = new IdGenerator();
		idGenerator_instance.setFieldname("INSTANCEID");
		defaultIDGenerator_instanceId = idGenerator_instance.getDefaultIDGenerator();
	}
	
	static {
		IdGenerator idGenerator_task = new IdGenerator();
		idGenerator_task.setFieldname("TASKID");
		defaultIDGenerator_taskId = idGenerator_task.getDefaultIDGenerator();
	}
	
	static {
		IdGenerator idGenerator_hisTask = new IdGenerator();
		idGenerator_hisTask.setFieldname("HISTASKID");
		defaultIDGenerator_hisTaskId = idGenerator_hisTask.getDefaultIDGenerator();
	}
	
	static {
		IdGenerator idGenerator_part = new IdGenerator();
		idGenerator_part.setFieldname("PARTID");
		defaultIDGenerator_partId = idGenerator_part.getDefaultIDGenerator();
	}
	
	public static String getInstanceId()
	{
		return defaultIDGenerator_instanceId.create();
	}
	
	public static String getTaskId()
	{
		return defaultIDGenerator_taskId.create();
	}
	
	public static String getHisTaskId()
	{
		return defaultIDGenerator_hisTaskId.create();
	}
	
	public static String getPartId()
	{
		return defaultIDGenerator_partId.create();
	}
	
	/*public static String getMyAppId(String idName)
	{
		IdGenerator idGenerator_eventid = new IdGenerator();
		idGenerator_eventid.setFieldname(idName);
		defaultIDGenerator_myAppId = idGenerator_eventid.getDefaultIDGenerator();
		
		return defaultIDGenerator_myAppId.create();
	}*/
}
